function user(){
    var userInput=document.getElementById("userInput").value;
    var username=document.getElementById("username");
    if(userInput.length<4){
        username.innerText="用户名长度不能小于4位";
        return false;
    }else if(userInput.length>8){
        username.innerText="用户名长度不能大于8位";
        return false;
    }else if(userInput===""){
        username.innerText="用户名不能为空";
        return false;
    }else{
        username.innerText="";
        return true;
    }
}

function pass(){
    var passInput=document.getElementById("passInput").value;
    var password=document.getElementById("password");
    if(passInput.length<4||passInput.length>8){
        password.innerText="密码长度在4到8位";
        return false;
    }else if(passInput===""){
        password.innerText="密码不能为空";
        return false;
    }else{
        password.innerText="";
        return true;
    }
}

function email(){
    var emailInput=document.getElementById("emailInput").value;
    var email=document.getElementById("email");
    var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
    if(emailInput===""){
        email.innerText="邮箱不能为空";
        return false;
    }else if(!myreg.test(emailInput)){
        email.innerText="邮箱格式不正确";
        return false;
    }else{
        email.innerText="";
        return true;
    }
}

function tel(){
    var telInput=document.getElementById("telInput").value;
    var tel=document.getElementById("tel");
    if(telInput.length<11){
        tel.innerText="电话必须是11位";
        return false;
    }else if(telInput===""){
        tel.innerText="电话不能为空";
        return false;
    }else{
        tel.innerText="";
        return true;
    }
}
